// 4.7 Data Validation

#include <stdio.h>
#include <math.h>

int main()
{

    float usernum;

    printf("This program calculates the square root and\n");
    printf("reciprocal (1/number) of a number\n");
    printf("\nPlease enter a number: ");
    scanf("%f", &usernum);

    if (usernum < 0.0)
        printf("The square root of a negative number does not exist.\n");
    else
        printf("The square root of %f is %f\n", usernum, sqrt(usernum));

    if (usernum == 0.0)
        printf("The reciprocal of zero does not exist.\n");
    else
        printf("The reciprocal of %f is %f\n", usernum, 1 / usernum);

    return 0;
}